p=0
for a in range(4):
    for b in range(4):
        c=8-a-b
        if c<=6:
            print 'A'*a,'B'*b,'C'*c
            p=p+1
print p